home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
B-Book Series
/
(k)b4.d64
/
solution4.17
< prev
next >
Wrap
Text File
|
2007-02-28
|
395b
|
18 lines
0010 DIM STACK(12), OP$ OF 4
0020 POINT:=1
0030 REPEAT
0040 INPUT "PUSH OR POP?": OP$
0050 CASE OP$ OF
0060 WHEN "PUSH"
0070 INPUT "WHAT NUMBER DO YOU WISH TO STACK?": NUM
0080 STACK(POINT):=NUM
0090 POINT:=POINT+1
0100 WHEN "POP"
0110 POINT:=POINT-1
0120 IF POINT<1 THEN STOP
0130 PRINT "POPPED ITEM IS";STACK(POINT)
0140 OTHERWISE
0150 PRINT "INPUT ERROR"
0160 ENDCASE
0170 UNTIL POINT>12